// recommendationApi.ts
import axios from 'axios';

const API_BASE_URL = 'http://localhost:8080/api/recommendations';

export const getRecommendations = async () => {
    try {
        const response = await axios.get(API_BASE_URL);
        return response.data;
    } catch (error) {
        console.error('Error fetching recommendations:', error);
        throw error;
    }
};

export const createRecommendation = async (recommendationData: any) => {
    try {
        const response = await axios.post(API_BASE_URL, recommendationData);
        return response.data;
    } catch (error) {
        console.error('Error creating recommendation:', error);
        throw error;
    }
};